﻿#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    int singleNumber(vector<int>& nums)
    {
        int result = 0;
        for (int i = 0; i < 32; ++i)
        {
            int num = 0;
            for (auto e : nums)
            {
                num += ((e >> i) & 1);
            }
            if (num % 3)
            {
                result |= (1 << i);
            }
        }
        return result;
    }
};





